class _ConfigUtils {
  static readIni(file: string): Promise<Record<string, Record<string, string>>>;
  static readIni(file: string, section: string): Promise<Record<string, string>>;
  static readIni(file: string, section: string, key: string): Promise<string>;
  static readIni(file: string, section?: string, key?: string): Promise<any> {
    return native.ipc.invoke("config.readIni", file, section, key);
  }

  static readYaml<T = any>(file: string): Promise<T>;
  static readYaml<T = any>(file: string, key: string): Promise<T>;
  static readYaml<T = any>(file: string, key?: string): Promise<T> {
    return native.ipc.invoke("config.readYaml", file, key);
  }

  static readSimpleConf(file: string): Promise<Record<string, string>>;
  static readSimpleConf(file: string, key: string): Promise<string>;
  static readSimpleConf(file: string, keys: string[]): Promise<Record<string, string>>;
  static readSimpleConf(file: string, key?: string | string[]): Promise<any> {
    return native.ipc.invoke("config.readSimpleConf", file, key);
  }
}

/**
 * 配置文件工具
 */
export const ConfigUtils = _ConfigUtils;
